-
Notifications
You must be signed in to change notification settings - Fork 1.2k
remove web3js dependency #6409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove web3js dependency #6409
Conversation
✅ Deploy Preview for reliable-cocada-166884 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
f7c3d36 to
eb191e2
Compare
17f3ee8 to
0c37735
Compare
| const { sendValue, sendUnit, gasLimit, selectedAccount } = state.settings; | ||
| const { address, decodedResponse, name } = state.instance; | ||
| const value = Web3.utils.toWei(sendValue, sendUnit); | ||
| const value = parseUnits(sendValue, sendUnit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you make sure the input types ar ethe same?
| const balance = await web3.eth.getBalance(address); | ||
| return Web3.utils.fromWei(balance.toString(10), 'ether'); | ||
| const balance = await provider.getBalance(address); | ||
| return formatUnits(balance.toString(10), 'ether'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, formatUnits https://docs.ethers.org/v6/api/utils/#formatUnits works with that
| ); | ||
| const receipt = await tryTillReceiptAvailable(transactionHash); | ||
| tx = await tryTillTxAvailable(transactionHash); | ||
| const signer = await (provider as BrowserProvider).getSigner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.getSigner(); wll default to get the signer for the account with index 0... not the selected one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| .setValue('*[id="search_include"]', '**').sendKeys('*[id="search_include"]', browser.Keys.ENTER).pause(4000) | ||
| .elements('css selector', '.search_plugin_search_line', (res) => { | ||
| Array.isArray(res.value) && browser.assert.equal(res.value.length, 61) | ||
| Array.isArray(res.value) && browser.assert.equal(res.value.length, 39) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change due to the fact the deploy-with-web3 script has been remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| } | ||
| const bytecode = '0x' + contract.object.evm.bytecode.object | ||
| const web3 = await this.call('blockchain', 'web3') | ||
| const signer = await web3.getSigner() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will get the first signer in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| try { | ||
| resultFn(null, await provider.sendAsync(payload)) | ||
| // browserProvider._send(payload: JsonRpcPayload | Array<JsonRpcPayload>) => Promise<Array<JsonRpcResult | JsonRpcError>> | ||
| resultFn(null, await provider._send(payload)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send or request not available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request is not available, see: https://docs.ethers.org/v6/api/providers/#BrowserProvider ._send returns the response in the way required for script runner
| try { | ||
| const res = await (this.getWeb3() as any).eth.personal.sendTransaction({ ...tx, value }, { checkRevertBeforeSending: false, ignoreGasPricing: true }) | ||
| cb(null, res.transactionHash, isCreation, false, null) | ||
| const res = await (await this.getWeb3().getSigner()).sendTransaction({ ...tx, value }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this takes the default signer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
04b0bbb to
c53ce90
Compare
fixes #6337